<?php
	include ("db.php");
	$sql = "select * from user where name='".$_POST["username"]."' and password='".$_POST["password"]."'";
	$result = mysql_query($sql);
	$total=mysql_num_rows($result);
	$rs=mysql_fetch_array($result);

	if($total==0){
	  header("Location:index.php?error=true");     
	}else{
		session_start();
		$_SESSION['username']=$_POST["username"];
		$_SESSION['company_id']=$rs["company_id"];
		$_SESSION['role_id']=$rs["role_id"];
  	}
  	mysql_close($con);
  	header("Location:channel.php?menuname=1_11");
?>
